home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
Tutorial
/
Cookbook
/
28.Motion
/
drawObjects.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-12
|
4KB
|
123 lines
/* drawObjects.c generated from drawObjects.psw
by unix pswrap V1.009 Wed Apr 19 17:50:24 PDT 1989
*/
#include <dpsclient/dpsfriends.h>
#include <string.h>
#line 1 "drawObjects.psw"
#line 10 "drawObjects.c"
void doBall(float x, float y, float width)
{
typedef struct {
unsigned char tokenType;
unsigned char topLevelCount;
unsigned short nBytes;
DPSBinObjReal obj0;
DPSBinObjReal obj1;
DPSBinObjReal obj2;
DPSBinObjReal obj3;
DPSBinObjReal obj4;
DPSBinObjGeneric obj5;
DPSBinObjGeneric obj6;
} _dpsQ;
static const _dpsQ _dpsStat = {
DPS_DEF_TOKENTYPE, 7, 60,
{DPS_LITERAL|DPS_REAL, 0, 0, 0}, /* param: x */
{DPS_LITERAL|DPS_REAL, 0, 0, 0}, /* param: y */
{DPS_LITERAL|DPS_REAL, 0, 0, 0}, /* param: width */
{DPS_LITERAL|DPS_REAL, 0, 0, 0.0},
{DPS_LITERAL|DPS_REAL, 0, 0, 360.0},
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 5}, /* arc */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 66}, /* fill */
}; /* _dpsQ */
_dpsQ _dpsF; /* local copy */
register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
char pad[3];
register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
_dpsF = _dpsStat; /* assign automatic variable */
_dpsP[0].val.realVal = x;
_dpsP[1].val.realVal = y;
_dpsP[2].val.realVal = width;
DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,60);
if (0) *pad = 0; /* quiets compiler warnings */
}
#line 3 "drawObjects.psw"
#line 50 "drawObjects.c"
void drawPaddle(float angle, float width)
{
typedef struct {
unsigned char tokenType;
unsigned char topLevelCount;
unsigned short nBytes;
DPSBinObjGeneric obj0;
DPSBinObjGeneric obj1;
DPSBinObjGeneric obj2;
DPSBinObjGeneric obj3;
DPSBinObjReal obj4;
DPSBinObjGeneric obj5;
DPSBinObjGeneric obj6;
DPSBinObjGeneric obj7;
DPSBinObjGeneric obj8;
DPSBinObjGeneric obj9;
DPSBinObjGeneric obj10;
DPSBinObjGeneric obj11;
DPSBinObjGeneric obj12;
DPSBinObjGeneric obj13;
DPSBinObjGeneric obj14;
DPSBinObjReal obj15;
DPSBinObjGeneric obj16;
DPSBinObjGeneric obj17;
DPSBinObjGeneric obj18;
DPSBinObjGeneric obj19;
DPSBinObjGeneric obj20;
DPSBinObjGeneric obj21;
DPSBinObjGeneric obj22;
DPSBinObjGeneric obj23;
} _dpsQ;
static const _dpsQ _dpsStat = {
DPS_DEF_TOKENTYPE, 24, 196,
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 78}, /* gsave */
{DPS_LITERAL|DPS_INT, 0, 0, 40},
{DPS_LITERAL|DPS_INT, 0, 0, 40},
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 173}, /* translate */
{DPS_LITERAL|DPS_REAL, 0, 0, 0}, /* param: angle */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 110}, /* neg */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 136}, /* rotate */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 111}, /* newpath */
{DPS_LITERAL|DPS_INT, 0, 0, -45},
{DPS_LITERAL|DPS_INT, 0, 0, 0},
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 107}, /* moveto */
{DPS_LITERAL|DPS_INT, 0, 0, 90},
{DPS_LITERAL|DPS_INT, 0, 0, 0},
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 133}, /* rlineto */
{DPS_LITERAL|DPS_INT, 0, 0, 0},
{DPS_LITERAL|DPS_REAL, 0, 0, 0}, /* param: width */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 110}, /* neg */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 133}, /* rlineto */
{DPS_LITERAL|DPS_INT, 0, 0, -90},
{DPS_LITERAL|DPS_INT, 0, 0, 0},
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 133}, /* rlineto */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 22}, /* closepath */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 66}, /* fill */
{DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 77}, /* grestore */
}; /* _dpsQ */
_dpsQ _dpsF; /* local copy */
register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
char pad[3];
register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
_dpsF = _dpsStat; /* assign automatic variable */
_dpsP[4].val.realVal = angle;
_dpsP[15].val.realVal = width;
DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,196);
if (0) *pad = 0; /* quiets compiler warnings */
}
#line 17 "drawObjects.psw"